﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

public partial class UserControl_TopBusiness : System.Web.UI.UserControl
{
    security baomat = new security();
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            StringBuilder sb = new StringBuilder();
            using (Up1VNDataContext dc = new Up1VNDataContext())
            {
                var ListTopBusiness = (from o in dc.EStores select o).ToList();
                if (ListTopBusiness.Count > 0)
                {
                    //sb.Append("<ul>");
                    foreach (var item in ListTopBusiness)
                    {
                        string logo = (item.EStore_Logo != null) ? ResolveUrl("~/User/avatar/" + item.EStore_Logo) : ResolveUrl("~/images/box.jpg");
                        sb.Append("<li><div class='box_1'>");
                        sb.Append("<a href='" + ResolveUrl("~/" + baomat.RemoveSpecialCharacter(item.EStore_Name).Replace(" ", "-").ToLower() + "/Thongtindoanhnghiep.html") + "'><img src='" + logo + "' alt='" + item.EStore_Name + "' title='" + item.EStore_Name + "' /></a>");
                        sb.Append("<h3><a href='" + ResolveUrl("~/" + baomat.RemoveSpecialCharacter(item.EStore_Name).Replace(" ", "-").ToLower() + "/Thongtindoanhnghiep.html") + "'>" + item.EStore_Name + "</a></h3>");
                        sb.Append("</div></li>");
                    }
                    //sb.Append("</ul>");
                    ltrTopBusiness.Text = sb.ToString();
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
}